<?php
declare (strict_types=1);

namespace app\common\model;

use ffhome\frame\model\BaseModel;
use ffhome\frame\util\CacheUtil;
use think\facade\Db;

class BaseBanner extends BaseModel
{
    const MODEL_NAME = 'base_banner';

    public static function getList(): array
    {
        return CacheUtil::get("banner_list", function () {
            $domain = sysValue('domain_name');
            return Db::name(self::MODEL_NAME)->field("id,concat('{$domain}',pic) pic,href")
                ->order('sort')->select()->toArray();
        }, self::MODEL_NAME, 600);
    }
}